package cc.magicjson.summary.errors.clz.not.found;

import java.io.File;

/**
 * {@link}
 *
 * @author <a href="mailto:it_magicjson@163.com">MagicJson</a>
 * @since 1.0.0
 */
public class FileLogger extends Logger {
    private static final File logFile;

    static {
        try {
            logFile = new File("app.log");
            if (!logFile.exists() && !logFile.createNewFile()) {
                throw new RuntimeException("Unable to create log file");
            }
        } catch (Exception e) {
            throw new ExceptionInInitializerError(e);
        }
    }

    @Override
    public void log(String message) {
        // 实现文件日志逻辑
        System.out.println("File logging: " + LOG_PREFIX + message);
    }
}
